111 |
1Z0-808 |
Given: |
111-qjpro.png |
ns = 100 s =125
ns = 0 s = 125
ns = 125 s = 125 |
ns = 50 s = 50
ns = 125 s = 125
ns = 0 s = 125 |
ns = 50 s = 125
ns = 125 s = 125
ns = 0 s = 125 |
ns = 50 s = 50
ns = 125 s =125
ns = 100 s =100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
110 |
1Z0-808 |
Given the code fragment: |
110-qjpro.png |
It results in a compile time error at line 18. |
It results in a compile time error at line 9. |
It prints : 1 |
It results in a compile time error at lines at lines 12 and 15. |
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
109 |
1Z0-808 |
Examine: |
109-qjpro.png |
The program prints m1.Accessed. |
The program fails compile due to the unhandled E1 exception. |
The program prints m2.Accessed. |
The program fails to compile due to the unhandled E2 exception. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
108 |
1Z0-808 |
Given the code fragment: |
108-qjpro.png |
1 2 3 0 0
1 2 3 0 0 |
An Exception is thrown at run time. |
1 2 3 0 0
1 2 3 |
1 2 3
1 2 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
107 |
1Z0-808 |
Given the code fragment: |
107-qjpro.png |
2 : 7 : 3 |
7 : 7 : 9 |
2 : 7 : 0 |
7 : 2 : 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
106 |
1Z0-808 |
Given the code fragment: |
106-qjpro.png |
A |
B |
C |
D |
E |
|
|
|
|
|
|
|
|
|
|
106-Ajpans.png |
106-Bjpans.png |
106-Cjpans.png |
106-Djpans.png |
106-Ejpans.png |
|
|
|
|
|
|
|
|
|
|
5 |
|
SC |
|
|
105 |
1Z0-808 |
Given the definitions of the Bird class and the Peacock class: |
105-qjpro.png |
Bird p = new Peacock(); |
Bird b = new Bird();
Peacock p = (Peacock) b; |
Peacock b = new Peacock ();
Bird p = (Bird) b; |
Bird b = new Peacock ();
Peacock p = (Peacock) b; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
104 |
1Z0-808 |
Given the code fragment: |
104-qjpro.png |
Comment lines 18 to 21. |
Comment line 20. |
Comment line 19. |
Comment line 16. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
103 |
1Z0-808 |
Given the code fragment: |
103-qjpro.png |
After line 11, three objects are eligible for garbage collection. |
After line 11, two objects are eligible for garbage collection. |
After line 11, one object is eligible for garbage collection. |
After line 11, none of the objects are eligible for garbage collection. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
102 |
1Z0-808 |
Given the code fragment: |
102-qjpro.png |
Answer = 0 |
Invalid calculation |
Compilation fails only at line n1. |
Compilation fails only at line n2. |
Compilation fails at line n1 and line2. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
101 |
1Z0-808 |
Given: |
101-qjpro.png |
A
B |
A
C |
C
C |
A ClassCastException is thrown only at line n1. |
A ClassCastException is thrown only at line n2. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
100 |
1Z0-808 |
Given the code fragment: |
100-qjpro.png |
Replace line 6 with System.out.print (--x); |
At line 7, insert x --; |
Replace line 5 with while (is Available(--x)) { |
Replace line 12 with return (x > 0) ? false : true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
99 |
1Z0-808 |
Given: |
99-qjpro.png |
c =
b = false
f = 0.0 |
c = null
b = true
f = 0.0 |
c = 0
b = false
f = 0.0F |
c = null
b = false
f = 0.0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
98 |
1Z0-808 |
Given the code fragment: |
98-qjpro.png |
Requirements 1, 2, and 3 can be implemented by using the enhanced for loop. |
Requirements 1, 2, and 3 can be implemented by using the standard for loop. |
Requirements 2 and 3 CANNOT be implemented by using the standard for loop. |
Requirement 2 can be implemented by using the enhanced for loop. |
Requirement 3 CANNOT be implemented by using either the enhanced for loop or the standard for loop. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2, 3 |
|
MC |
|
|
97 |
1Z0-808 |
Given: |
97-qjpro.png |
3 4 5 6 |
3 4 3 6 |
5 4 5 6 |
3 6 5 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
96 |
1Z0-808 |
Given: |
96-qjpro.png |
C1C2 |
C1C1 |
Compilation fails. |
C2C2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
95 |
1Z0-808 |
Given: |
95-qjpro.png |
Welcome Visit Count:0
Welcome Visit Count: 1 |
Compilation fails at line n2. |
Compilation fails at line n1. |
Welcome Visit Count:0
Welcome Visit Count: 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
94 |
1Z0-808 |
Given the code fragment: |
94-qjpro.png |
Make the method at line 8 protected. |
Make the method at line 8 public. |
Make the method at line 10 protected. |
Make the method at line 4 public. |
Make the method at line 2 public. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1, 3 |
|
MC |
|
|
93 |
1Z0-808 |
Which three statements are true about the structure of a Java class? (Choose three.) |
|
A class cannot have the same name as its field. |
A public class must have a main method. |
A class can have final static methods. |
A class can have overloaded private constructors. |
Fields need to be initialized before use. |
Methods and fields are optional components of a class. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2, 4, 5 |
|
MC |
|
|
92 |
1Z0-808 |
Given the code fragment: |
92-qjpro.png |
omas
Invalid Name
null |
omas
ter
seph |
Invalid Name |
omas
Invalid Name |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
91 |
1Z0-808 |
Given the code fragment: |
91-qjpro.png |
A
B |
A element 0
B element 1 |
A NullPointerException is thrown at runtime. |
A 0
B 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
90 |
1Z0-808 |
Given the code fragment: |
90-qjpro.png |
Compilation fails. |
The program compiles, but it prints nothing. |
HiHowAreYou removed |
An UnsupportedOperationException is thrown at runtime. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
89 |
1Z0-808 |
Given the code fragment: |
89-qjpro.png |
3 |
0 |
Compilation fails. |
-1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
88 |
1Z0-808 |
Given the code snippet from a compiled Java source file: |
88-qjpro.png |
java MyFile 2 |
java MyFile 1 2 3 4 |
java MyFile 1 2 2 |
java MyFile 2 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
87 |
1Z0-808 |
Given the code fragment: |
87-qjpro.png |
2012-02-10 00:00 |
2012-01-30 |
2012-02-10 |
A DateTimeException is thrown at runtime. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
86 |
1Z0-808 |
Given: |
86-qjpro.png |
Compilation fails at line n2. |
Compilation fails at line n1. |
20:20 |
10:20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
85 |
1Z0-808 |
Given this segment of code: |
83-qjpro.png |
MotorCycle is an interface that implements the Cycle class. |
Cycle is an interface that is implemented by the MotorCycle class. |
Cycle is an abstract superclass of MotorCycle. |
Cycle and MotorCycle both extend the Transportation superclass. |
Cycle and MotorCycle both implement the Transportation interface. |
MotorCycle is a superclass of Cycle. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2, 3 |
|
MC |
|
|
84 |
1Z0-808 |
Which is true about the switch statement? |
|
Its expression can evaluate to a collection of values. |
The break statement, at the end of each case block, is optional. |
Its case label literals can be changed at runtime. |
It must contain the default section. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
83 |
1Z0-808 |
Which two statements are true about Java byte code? (Choose two.) |
|
It can be serialized across network. |
It can run on any platform that has a Java compiler. |
It can run on any platform. |
It has “.java†extension. |
It can run on any platform that has the Java Runtime Environment. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1, 5 |
|
MC |
|
|
82 |
1Z0-808 |
This grid shows the state of a 2D array: |
82-qjpro.png |
String main 1 |
An exception is thrown at runtime |
String main 1 2 3 |
String main 123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
81 |
1Z0-808 |
This grid shows the state of a 2D array: |
81-qjpro.png |
grid[2][1] = 'X'; |
grid[3][2] = 'X'; |
grid[3][1] = 'X'; |
grid[2][3] = 'X'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
80 |
1Z0-808 |
Given: |
80-qjpro.png |
null
Richard
Donald |
Richard
Donald |
Compilation fails. |
An ArrayIndexOutOfBoundsException is thrown at runtime. |
A NullPointerException is thrown at runtime. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
SC |
|
|
79 |
1Z0-808 |
Given the code fragment: |
79-qjpro.png |
Compilation fails. |
Hi removed |
An UnsupportedOperationException is thrown at runtime. |
The program compiles, but it prints nothing. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
78 |
1Z0-808 |
Given: |
78-qjpro.png |
10 Hello Hello 11 |
10 Hello Hello 121 |
100 Hello 121 |
100 Hello Hello 121 |
10 Hello 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
SC |
|
|
77 |
1Z0-808 |
Given: |
77-qjpro.png |
Compilation fails. |
3 5 |
0 0 |
9 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
76 |
1Z0-808 |
Given the code fragment: |
76-qjpro.png |
A |
B |
C |
D |
E |
|
|
|
|
|
|
|
|
|
|
76-Ajpans.png |
76-Bjpans.png |
76-Cjpans.png |
76-Djpans.png |
76-Ejpans.png |
|
|
|
|
|
|
|
|
|
|
1, 4, 5 |
|
MC |
|
|
75 |
1Z0-808 |
Given the code fragments: |
75-qjpro.png |
2012-02-10 |
2012-02-11 |
Compilation fails |
A DateTimeException is thrown at runtime. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
74 |
1Z0-808 |
Given the code fragments: |
74-qjpro.png |
After line 11, three objects are eligible for garbage collection. |
After line 11, two objects are eligible for garbage collection. |
After line 11, one object is eligible for garbage collection. |
After line 11, none of the objects are eligible for garbage collection. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
73 |
1Z0-808 |
Given: |
73-qjpro.png |
At line n1 insert: import clothing.Shirt;
At line n2 insert: String color = Shirt.getColor(); |
At line n1 insert: import clothing;
At line n2 insert: String color = Shirt.getColor(); |
At line n1 insert: import static clothing.Shirt.getColor;
At line n2 insert: String color = getColor(); |
At line n1 no changes required.
At line n2 insert: String color = Shirt.getColor(); |
At line n1 insert: import Shirt;
At line n2 insert: String color = Shirt.getColor(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
72 |
1Z0-808 |
Given: |
72-qjpro.png |
C2C2 |
C1C2 |
C1C1 |
Compilation fails |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
71 |
1Z0-808 |
Given: |
71-qjpro.png |
300:300
200:300 |
300:100
200:300 |
300:0
0:300 |
100:300
300:200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
70 |
1Z0-808 |
Given: |
70-qjpro.png |
Java SE |
Java EE |
Compilation fails at line n1. |
A NullPointerException is thrown at runtime. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
69 |
1Z0-808 |
Given the code fragment: |
69-qjpro.png |
An exception is thrown at runtime. |
07-31-2014 |
2014-07-31 |
2014-09-30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
68 |
1Z0-808 |
Which two statements are true? (Choose two.) |
|
Error class is unextendable. |
Error class is extendable. |
Error is a RuntimeException. |
Error is an Exception. |
Error is a Throwable. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2, 5 |
|
MC |
|
|
67 |
1Z0-808 |
Given the code fragment: |
67-qjpro.png |
A |
B |
C |
D |
E |
|
|
|
|
|
|
|
|
|
|
67-Ajpans.png |
67-Bjpans.png |
67-Cjpans.png |
67-Djpans.png |
67-Ejpans.png |
|
|
|
|
|
|
|
|
|
|
5 |
|
SC |
|
|
66 |
1Z0-808 |
Given: |
66-qjpro.png |
10 20 30 40 |
0 0 30 40 |
Compilation fails. |
An exception is thrown at runtime. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
65 |
1Z0-808 |
Given the code fragment: |
65-qjpro.png |
A NullPointerException is thrown at runtime. |
[1, 2, 4] |
[1, 2, 4, null] |
[1, 3, 4, null] |
[1, 3, 4] |
Compilation fails. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
64 |
1Z0-808 |
Given the code fragment: |
64-qjpro.png |
Compilation fails at both line n1 and line n2. |
Compilation fails only at line n2. |
Compilation fails only at line n1. |
Jesse 25
Walter 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
63 |
1Z0-808 |
Given: |
63-qjpro.png |
Compilation fails at line n3 and line n4. |
Compilation fails at line n1 and line n2. |
Welcome Visit Count:1
Welcome Visit Count: 1 |
Welcome Visit Count:1
Welcome Visit Count: 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
62 |
1Z0-808 |
Given the code fragment: |
62-qjpro.png |
Result A 01
Result B 3 |
Result A 1
Result B 12 |
Result A 1
Result B 3 |
Result A 01
Result B 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
61 |
1Z0-808 |
Which three statements are true about the structure of a Java class? (Choose three.) |
|
A public class must have a main method. |
A class can have only one private constructor. |
A method can have the same name as a field. |
A class can have overloaded static methods. |
The methods are mandatory components of a class. |
The fields need not be initialized before use. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1, 3, 5 |
|
MC |
|
|
60 |
1Z0-808 |
You are asked to create a method that accepts an array of integers and returns the highest value from that array. |
60-qjpro.png |
public int findMax (int[] numbers) |
static int[] findMax (int[] max) |
static int findMax (int[] numbers) |
final int findMax (int[] ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
59 |
1Z0-808 |
Given: |
59-qjpro.png |
A
B |
A
C |
C
C |
A ClassCastException is thrown only at line n1. |
A ClassCastException is thrown only at line n2. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
58 |
1Z0-808 |
Given the code fragment: |
58-qjpro.png |
Compilation fails in the Employee class. |
null : 0: 0
Jack : 50 : 0
Chloe : 40 : 5000 |
null : 0 : 0
Jack : 50 : 2000
Chloe : 40 : 5000 |
Compilation fails in the Test class. |
Both the Employee class and the Test class fail to compile. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
SC |
|
|
57 |
1Z0-808 |
Given the code fragment: |
57-qjpro.png |
Invalid Name |
Invalid Name
omas |
Invalid Name
omas
null
null |
omas
ter
seph |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
56 |
1Z0-808 |
Given: |
56-qjpro.png |
Replace line n1 with: |
Replace line n1 with: |
Replace line n2 with: |
Replace line n1 with: |
Replace line n2 with: |
|
|
|
|
|
|
|
|
|
|
56-Ajpans.png |
56-Bjpans.png |
56-Cjpans.png |
56-Djpans.png |
56-Ejpans.png |
|
|
|
|
|
|
|
|
|
|
1, 5 |
|
MC |
|
|
55 |
1Z0-808 |
Which statement is true about the switch statement? |
|
It must contain the default section. |
The break statement, at the end of each case block, is mandatory. |
Its case label literals can be changed at runtime. |
Its expression must evaluate to a single value. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
54 |
1Z0-808 |
Given: |
54-qjpro.png |
Option A |
Option B |
Option C |
Option D |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
53 |
1Z0-808 |
Which statement will empty the contents of a StringBuilder variable named sb? |
|
sb. deleteAll (); |
sb. delete (0, sb. size () ); |
sb. delete (0, sb. length () ); |
sb. removeAll (); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
52 |
1Z0-808 |
Given the code fragment: |
52-qjpro.png |
Compilation fails. |
1 3
1 3 |
1 3
followed by an ArrayIndexOutOfBoundException |
1 3
1 3 0 0 |
1 3 5 7
1 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
SC |
|
|
51 |
1Z0-808 |
Given: |
51-qjpro.png |
1 null |
true false |
false false |
true true |
A ClassCastException is thrown at runtime. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
50 |
1Z0-808 |
Given the code fragment: |
50-qjpro.png |
Compilation fails. |
10 Hello Universe! |
10 Hello World! |
9 Hello World! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
49 |
1Z0-808 |
Given: |
49-qjpro.png |
a, e
i, i |
a, e
o, o |
e, e
i, i |
a, a
o, o |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
48 |
1Z0-808 |
Given: |
48-qjpro.png |
100 200 : 0 0 : |
100 200 : 100 0 : |
100 200 : 100 200 : |
0 0 : 100 0 : |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
47 |
1Z0-808 |
Given: |
47-qjpro.png |
An exception is thrown at runtime. |
Initialized
Started
Initialized |
Initialized
Started |
Compilation fails. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
46 |
1Z0-808 |
Given: |
46-qjpro.png |
true:true |
true:false |
false:true |
false:false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
45 |
1Z0-808 |
Given the code fragment: |
45-qjpro.png |
1:2:3:4:5: |
1:2:3: |
Compilation fails. |
An ArrayOutOfBoundsException is thrown at runtime. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
44 |
1Z0-808 |
Given: |
44-qjpro.png |
myStr: 9009, myNum: 9009 |
myStr: 7007, myNum: 7007 |
myStr: 7007, myNum: 9009 |
Compilation fails |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
43 |
1Z0-808 |
Given the code fragment: |
43-qjpro.png |
byte x = 1; |
short x = 1; |
String x = "1"; |
long x = 1; |
double x = 1; |
Integer x = new Integer("1"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1, 2, 6 |
|
MC |
|
|
42 |
1Z0-808 |
Which statement is true about Java byte code? |
|
It can run on any platform. |
It can run on any platform only if it was compiled for that platform. |
It can run on any platform that has the Java Runtime Environment. |
It can run on any platform that has a Java compiler. |
It can run on any platform only if that platform has both the Java Runtime Environment and a Java compiler. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
41 |
1Z0-808 |
Given the following class declarations: |
41-qjpro.png |
Option A |
Option B |
Option C |
Option D |
Option E |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
SC |
|
|
40 |
1Z0-808 |
Given: |
40-qjpro.png |
400 200 |
200 200 |
400 400 |
Compilation fails. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
39 |
1Z0-808 |
Given the code fragment: |
39-qjpro.png |
Requirements 1, 2, and 3 can be implemented by using the enhanced for loop. |
Requirements 1, 2, and 3 can be implemented by using the standard for loop. |
Requirements 2 and 3 CANNOT be implemented by using the standard for loop. |
Requirement 1 can be implemented by using the enhanced for loop. |
Requirement 3 CANNOT be implemented by using either the enhanced for loop or the standard for loop. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4, 5 |
|
MC |
|
|
38 |
1Z0-808 |
Given the content of three files: |
38-qjpro.png |
Only the A.Java file compiles successfully. |
Only the B.java file compiles successfully. |
Only the C.java file compiles successfully. |
The A.Java and B.java files compile successfully. |
The B.java and C.java files compile successfully. |
The A.Java and C.java files compile successfully. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
37 |
1Z0-808 |
Given the following code: |
37-qjpro.png |
15, 60, 45, 90, 75 |
15, 90, 45, 90, 75 |
15, 30, 75, 60, 90 |
15, 30, 90, 60, 90 |
15, 4, 45, 60, 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
36 |
1Z0-808 |
Given the code fragment: |
36-qjpro.png |
A |
B |
C |
D |
|
|
|
|
|
|
|
|
|
|
|
36-Ajpro.png |
36-Bjpro.png |
36-Cjpro.png |
36-Djpro.png |
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
35 |
1Z0-808 |
Given the code fragment: |
35-qjpro.png |
Line 7 |
Line 8 |
Line 9 |
Line 10 |
Line 11 |
Line 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1, 4, 6 |
|
MC |
|
|
34 |
1Z0-808 |
Given the definitions of the MyString class and the Test class: |
34-qjpro.png |
Hello Java SE 8
Hello Java SE 8 |
Hello java.lang.StringBuilder@<>
Hello p1.MyString@<> |
Hello Java SE 8
Hello p1.MyString@<> |
Compilation fails at the Test class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
33 |
1Z0-808 |
|
33-qjpro.png |
10:20 |
0:20 |
Compilation fails at line n1 |
Compilation fails at line n2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
32 |
1Z0-808 |
Given the code fragment: |
32-qjpro.png |
Element 0
Element 1 |
Null element 0
Null element 1 |
Null
Null |
A NullPointerException is thrown at runtime. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
31 |
1Z0-808 |
Given the code fragment: |
31-qjpro.png |
Option A |
Option B |
Option C |
Option D |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
30 |
1Z0-808 |
Given the code fragment: |
30-qjpro.png |
true true |
true false |
false false |
false true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
29 |
1Z0-808 |
Which code fragment, when inserted at line n1, enables the code to print Hank? |
29-qjpro.png |
checkAge (iList, ( ) -> p. get Age ( ) > 40); |
checkAge (iList, Person p -> p.getAge( } > 40); |
checkAge (iList, p -> p. getAge ( ) > 40); |
checkAge (iList, (Person p) -> { p.getAge() > 40; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
28 |
1Z0-808 |
Given the code fragment: |
28-qjpro.png |
Execution terminates in the first catch statement, and Caught a RuntimeException is printed to the console. |
Execution terminates in the second catch statement, and Caught an Exception is printed to the console. |
A runtime error is thrown in the thread "main". |
Execution completes normally, and Ready to use is printed to the console. |
The code fails to compile because a throws keyword is required. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
27 |
1Z0-808 |
Given: |
27-qjpro.png |
Both p and s are accessible via obj. |
Only s is accessible via obj. |
Both r and s are accessible via obj. |
p, r, and s are accessible via obj. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
26 |
1Z0-808 |
You are developing a banking module. You have developed a class named ccMask that has a maskcc method. |
26-qjpro.png |
Option A |
Option B |
Option C |
Option D |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2, 3 |
|
MC |
|
|
25 |
1Z0-808 |
Given the following code: |
25-qjpro.png |
4
4
|
3
5 |
4
7 |
5
4 |
4
5 |
4
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
SC |
|
|
24 |
1Z0-808 |
Which three statements describe the object-oriented features of the Java language? (Choose three.) |
|
Objects can be reused. |
A subclass must override the methods from a superclass. |
Objects can share behaviors with other objects. |
A package must contain a main class. |
Object is the root class of all other objects. |
A main method must be declared in every class. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2, 3, 6 |
|
MC |
|
|
23 |
1Z0-808 |
Given: |
23-qjpro.png |
Success |
Failure |
Compilation fails. |
An exception is thrown at runtime |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
22 |
1Z0-808 |
Given the code fragment: |
22-qjpro.png |
Option A |
Option B |
Option C |
Option D |
Option E |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1, 3 |
|
MC |
|
|
21 |
1Z0-808 |
Given: |
21-qjpro.png |
Compilation fails. |
false true |
true false |
true true |
false false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
20 |
1Z0-808 |
Given the code fragment: |
20-qjpro.png |
String str2 = str1; |
String str2 = new String(str1); |
String str2 = sb1. toString(); |
String str2 = "Duke"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
19 |
1Z0-808 |
Given the code fragment: |
19-qjpro.png |
date1 = 2014-06-20
date2 = 2014-06-20
date3 = 2014-06-20 |
date1 = 06/20/2014
date2 = 2014-06-20
date3 = Jun 20, 2014 |
Compilation fails. |
An exception is thrown at runtime. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
18 |
1Z0-808 |
Given the code fragment: |
18-qjpro.png |
2 4 |
0 2 4 6 |
0 2 4 |
Compilation fails |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
17 |
1Z0-808 |
Given: |
17-qjpro.png |
Option A |
Option B |
Option C |
Option D |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
16 |
1Z0-808 |
Given the code from the Greeting.Java file: |
16-qjpro.png |
Option A |
Option B |
Option C |
Option D |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
15 |
1Z0-808 |
Given the code fragment: |
15-qjpro.png |
A B C Work done |
A B C D Work done |
A Work done |
Compilation fails |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
14 |
1Z0-808 |
Given the code fragment: |
14-qjpro.png |
int[] array = new int[1]; |
int[] array;
array = new int[2];
|
int array = new int[2]; |
int array[1]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
13 |
1Z0-808 |
Given: |
13-qjpro.png |
C B A |
C |
A B C |
Compilation fails at line n1 and line n2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
12 |
1Z0-808 |
Given the code fragment: |
12-qjpro.png |
Option A |
Option B |
Option C |
Option D |
Option E |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1, 3 |
|
MC |
|
|
11 |
1Z0-808 |
Given the code fragment: |
11-qjpro.png |
100 |
101 |
102 |
103 |
Compilation fails |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
10 |
1Z0-808 |
Given the following main method: |
10-qjpro.png |
5 4 3 2 1 0 |
5 4 3 2 1 |
4 2 1 |
5 |
Nothing is printed |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
SC |
|
|
9 |
1Z0-808 |
Given the code fragment: |
9-qjpro.png |
Replace line 6 with System.out. print (--x) ; |
At line 7, insert x --; |
Replace line 6 with --x; and, at line 7, insert System.out.print (x); |
Replace line 12 with return (x > 0) ? false: true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|
8 |
1Z0-808 |
Given this class: |
|
acct.setAmount(-acct.getAmount()); |
acct.amount = 0; <option D earlier> |
acct.setAmount(0); |
acct.getAmount() = 0; <option E earlier> |
this.amount = 0; <option A earlier> |
acct.changeAmount(0); <option F earlier> |
acct.changeAmount(-acct.amount); <option G earlier> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2, 4, 6 |
|
MC |
|
|
7 |
1Z0-808 |
Given the code fragment from three files: |
7-qjpro.png |
import sales.*; |
import java.sales.products.*; |
import sales;
import sales.products;
|
import sales.*;
import products.*;
|
import sales.*;
import sales.products.*; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
SC |
|
|
6 |
1Z0-808 |
Given: |
6-qjpro.png |
A B C D |
A C D |
A C D D |
A B D |
A B D C |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
5 |
1Z0-808 |
Given these two classes: |
5-qjpro.png |
A |
B |
C |
D |
|
|
|
|
|
|
|
|
|
|
|
5-Ajpro.png |
5-Bjpro.png |
5-Cjpro.png |
5-Djpro.png |
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
4 |
1Z0-808 |
Given: |
4-qjpro.png |
Compilation fails at line n1. |
Initialized
Started
Initialized
|
Initialized
Started |
Compilation fails at line n2. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
3 |
1Z0-808 |
What is the name of the Java concept that uses access modifiers to protect variables and hide them within a class? |
|
Encapsulation |
Inheritance |
Abstraction |
Instantiation |
Polymorphism |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
SC |
|
|
2 |
1Z0-808 |
Given the code fragment: |
2-qjpro.png |
Sum is 600 |
Compilation fails at line n1. |
Compilation fails at line n2. |
A ClassCastException is thrown at line n1. |
A ClassCastException is thrown at line n2. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
SC |
|
|
1 |
1Z0-808 |
Given the code fragment: |
1-qjpro.png |
May 04, 2014T00:00:00.000 |
2014-05-04T00:00: 00.000 |
5/4/14T00:00:00.000 |
An exception is thrown at runtime. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
SC |
|
|